package me.raih.controller.admin.common;

import me.raih.pojo.vo.OtherWeb;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;

/**
 * @Author Raih
 * @Time 2020/12/28 12:13
 */
@Controller
@RequestMapping(value = "/admin/other")
public class WebController {

    @Autowired
    OtherWeb web;

    @RequestMapping(value = "/caiGou")
    public void toCaiGou(HttpServletResponse response) throws IOException {

        Map<String, String> webUrl = web.getWebUrl();
        String caiGou = webUrl.get("caiGou");
        response.sendRedirect(caiGou);
    }


    @RequestMapping(value = "/baiXing")
    public void toBaiXing(HttpServletResponse response) throws IOException {
        Map<String, String> webUrl = web.getWebUrl();
        String baiXing = webUrl.get("baiXing");
        response.sendRedirect(baiXing);
    }

    @RequestMapping(value = "/chuangXin")
    public void toChuangXin(HttpServletResponse response) throws IOException {
        Map<String, String> webUrl = web.getWebUrl();
        String chuangXin = webUrl.get("chuangXin");
        response.sendRedirect(chuangXin);
    }
}
